<template>
  <div>
    <!-- <Order /> -->
    <Plan />
    <!-- 侧边栏抽屉 -->
    <Drawer v-model="isDrawerShow" :info="drawList" />
  </div>
</template>
<script lang="ts" setup>
import {
  ref,
  provide,
  onMounted,
  reactive,
  onBeforeUnmount,
  markRaw,
} from "vue";

import useCurrentInstance from "@/utils/useCurrentInstance";
import { useDictionary } from "@/store/backend/tool/dictionary";
import { useProductionPlan } from "@/store/backend/ProductionPlan/plan";
import { useBomM } from "@/store/backend/BomM/bomM";
import { useBomDict } from "@/store/backend/BomM/bomDict";
import { useFactoryStation } from "@/store/backend/FactoryM/stationInfo";
import { useProductionWorkOrder } from "@/store/backend/ProductionPlan/workOrder";
import Order from "./workorderTable.vue";
import Plan from "./planTable.vue";
import Drawer from "./components/aside.vue";
import { useDept } from "@/store/backend/SysM/dept";

const dictionary = useDictionary();
const plan = useProductionPlan();
const bom = useBomM();
const bomD = useBomDict();
const station = useFactoryStation();
const planOrder = useProductionWorkOrder();
const dept = useDept();

const isDrawerShow = ref(false);
let drawList = reactive({});
//全局事件总线
const { proxy } = useCurrentInstance();

const state: {} = reactive({});
proxy.eventBus.on("workOrderDrawer", () => {
  isDrawerShow.value = true;
});
onMounted(() => {});
onBeforeUnmount(() => {
  proxy.eventBus.off("workOrderDrawer");
});
// 实例化表格后，将 baTable 的实例提供给上下文
provide("dictionary", dictionary);
provide("plan", plan);
provide("bom", bom);
provide("bomD", bomD);
provide("station", station);
provide("dept", dept);
</script>
<style lang="scss" scoped>
.default-main {
  margin: 0px !important;
  margin-bottom: 30px !important;
}
</style>
